<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/29
  Time: 9:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="bean.User" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String name = request.getParameter("loginName");
    String pwd = request.getParameter("pwd");
//    初始化
    User user=new User(name,pwd);
//    校验用户名密码
    boolean flag=user.checkUser();
    if(flag){
 %>
<jsp:forward page="welcome.jsp">
    <jsp:param name="name" value="<%=user.getLoginName()%>"/>
</jsp:forward>
<%
    }else{
%>
<jsp:forward page="login.jsp">
    <jsp:param value="login error!!!!" name="errMsg"></jsp:param>
</jsp:forward>

<%
    }
%>

</body>
</html>
